fix(schema): allow ANNOTATION_TYPE in storage CHECK constraints#420
Merged
Conversation
#419 fixed annotations.schema.json's elementKind enum but missed two other independent copies of the same enum that also needed the fix: - storage/schema.py's annotations_impls/annotations_tests CHECK constraints -- these silently dropped the row via `INSERT OR IGNORE` with no warning logged, so a requirement/SVC with an ANNOTATION_TYPE annotation location passed schema validation but then vanished from the database with no error at all - export_output.schema.json's own element_kind enum copy (used by the export command's output validation, tested by test_output_schemas.py) Found by re-running reqstool-java-annotations#166's CI: the schema error from #419 was gone, but ANNOTATIONS_001 (the requirement self-applied to the Requirements/SVCs annotation declarations themselves) still showed "not implemented" with no error -- the CHECK constraint silently swallowing the insert. Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #419, which fixed
annotations.schema.json'selementKindenum but missed two other independent copies of the same enum:storage/schema.py'sannotations_impls/annotations_testsCHECKconstraints — these silently dropped the row viaINSERT OR IGNOREwith no warning logged, so a requirement/SVC with anANNOTATION_TYPEannotation location passed schema validation but then vanished from the database with no error at all.export_output.schema.json's ownelement_kindenum copy (used by theexportcommand's output validation, tested bytest_output_schemas.py).Found by re-running reqstool-java-annotations#166's CI after merging #419: the schema validation error was gone, but
ANNOTATIONS_001(the requirement self-applied to theRequirements/SVCsannotation declarations themselves) still showed "not implemented" with no error — confirming theCHECKconstraint gap was silently swallowing the insert.Test plan
hatch run dev:pytest --cov=reqstool— 938 passed, 2 skipped (unrelated)pipx install --force -e .) againstreqstool-java-annotations's real self-applied dataset: full two-pass self-apply build →reqstool status→ 3/3 requirements complete, PASS (previously 2/3,ANNOTATIONS_001silently missing)